<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>gdsl: gdsl_heap.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">gdsl
   &#160;<span id="projectnumber">1.7</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('gdsl__heap_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">gdsl_heap.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="gdsl__heap_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * This file is part of the Generic Data Structures Library (GDSL).</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2006 Nicolas Darnis &lt;ndarnis@free.fr&gt;.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * The GDSL library is free software; you can redistribute it and/or </span>
<a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU General Public License as </span>
<a name="l00007"></a>00007 <span class="comment"> * published by the Free Software Foundation; either version 2 of</span>
<a name="l00008"></a>00008 <span class="comment"> * the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * The GDSL library is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00016"></a>00016 <span class="comment"> * along with the GDSL library; see the file COPYING.</span>
<a name="l00017"></a>00017 <span class="comment"> * If not, write to the Free Software Foundation, Inc., </span>
<a name="l00018"></a>00018 <span class="comment"> * 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.</span>
<a name="l00019"></a>00019 <span class="comment"> *</span>
<a name="l00020"></a>00020 <span class="comment"> * $RCSfile: gdsl__heap_8h_source.html,v $</span>
<a name="l00021"></a>00021 <span class="comment"> * $Revision: 1.3 $</span>
<a name="l00022"></a>00022 <span class="comment"> * $Date: 2013/06/12 16:36:13 $</span>
<a name="l00023"></a>00023 <span class="comment"> */</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#ifndef _GDSL_HEAP_H_</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define _GDSL_HEAP_H_</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="gdsl__types_8h.html">gdsl_types.h</a>&quot;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> 
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 
<a name="l00054"></a><a class="code" href="group__gdsl__heap.html#ga78edcc85d3172b3983098958b91d6e44">00054</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>heap* <a class="code" href="group__gdsl__heap.html#ga78edcc85d3172b3983098958b91d6e44" title="GDSL heap type.">gdsl_heap_t</a>;
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 <span class="comment">/******************************************************************************/</span>
<a name="l00057"></a>00057 <span class="comment">/* Management functions of heaps                                              */</span>
<a name="l00058"></a>00058 <span class="comment">/******************************************************************************/</span>
<a name="l00059"></a>00059 
<a name="l00082"></a>00082 <span class="keyword">extern</span> gdsl_heap_t
<a name="l00083"></a>00083 <a class="code" href="group__gdsl__heap.html#gad1346deeacc31ebad0ec43326210e91b" title="Create a new heap.">gdsl_heap_alloc</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* NAME,
<a name="l00084"></a>00084          <a class="code" href="group__gdsl__types.html#ga32a9b4e8b9665183c2741d28a5ced64f" title="GDSL Alloc element function type.">gdsl_alloc_func_t</a> ALLOC_F,
<a name="l00085"></a>00085          <a class="code" href="group__gdsl__types.html#ga2c6b3f96b291b5b39d2799f93e350053" title="GDSL Free element function type.">gdsl_free_func_t</a> FREE_F,
<a name="l00086"></a>00086          <a class="code" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7" title="GDSL Comparison element function type.">gdsl_compare_func_t</a> COMP_F
<a name="l00087"></a>00087          );
<a name="l00088"></a>00088 
<a name="l00102"></a>00102 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00103"></a>00103 <a class="code" href="group__gdsl__heap.html#ga35fbed7f124a3f5c7e560a7cf9505020" title="Destroy a heap.">gdsl_heap_free</a> (gdsl_heap_t H
<a name="l00104"></a>00104         );
<a name="l00105"></a>00105 
<a name="l00119"></a>00119 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00120"></a>00120 <a class="code" href="group__gdsl__heap.html#ga4ead06c95c01b78c9e5c25389a1dff04" title="Flush a heap.">gdsl_heap_flush</a> (gdsl_heap_t H
<a name="l00121"></a>00121          );
<a name="l00122"></a>00122 
<a name="l00123"></a>00123 <span class="comment">/******************************************************************************/</span>
<a name="l00124"></a>00124 <span class="comment">/* Consultation functions of heaps                                            */</span>
<a name="l00125"></a>00125 <span class="comment">/******************************************************************************/</span>
<a name="l00126"></a>00126 
<a name="l00136"></a>00136 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*
<a name="l00137"></a>00137 <a class="code" href="group__gdsl__heap.html#ga042886cdec3eab67e5c9846dcf372153" title="Get the name of a heap.">gdsl_heap_get_name</a> (<span class="keyword">const</span> gdsl_heap_t H
<a name="l00138"></a>00138             );
<a name="l00139"></a>00139 
<a name="l00147"></a>00147 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>
<a name="l00148"></a>00148 <a class="code" href="group__gdsl__heap.html#ga0b07df738a31dea80792fdc09f1faafe" title="Get the size of a heap.">gdsl_heap_get_size</a> (<span class="keyword">const</span> gdsl_heap_t H
<a name="l00149"></a>00149             );
<a name="l00150"></a>00150 
<a name="l00161"></a>00161 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00162"></a>00162 <a class="code" href="group__gdsl__heap.html#gafb1797eb31cd1c7f9011dc5170b3e694" title="Get the top of a heap.">gdsl_heap_get_top</a> (<span class="keyword">const</span> gdsl_heap_t H
<a name="l00163"></a>00163            );
<a name="l00164"></a>00164 
<a name="l00173"></a>00173 <span class="keyword">extern</span> <span class="keywordtype">bool</span> 
<a name="l00174"></a>00174 <a class="code" href="group__gdsl__heap.html#gaec7eb81d14c4509c7d8f8b1e77fdaae3" title="Check if a heap is empty.">gdsl_heap_is_empty</a> (<span class="keyword">const</span> gdsl_heap_t H
<a name="l00175"></a>00175             );
<a name="l00176"></a>00176 
<a name="l00177"></a>00177 <span class="comment">/******************************************************************************/</span>
<a name="l00178"></a>00178 <span class="comment">/* Modification functions of heaps                                            */</span>
<a name="l00179"></a>00179 <span class="comment">/******************************************************************************/</span>
<a name="l00180"></a>00180   
<a name="l00194"></a>00194 <span class="keyword">extern</span> gdsl_heap_t
<a name="l00195"></a>00195 <a class="code" href="group__gdsl__heap.html#ga006557ed075fb78f548f7d174ba3dc92" title="Set the name of a heap.">gdsl_heap_set_name</a> (gdsl_heap_t H,
<a name="l00196"></a>00196             <span class="keyword">const</span> <span class="keywordtype">char</span>* NEW_NAME
<a name="l00197"></a>00197             );
<a name="l00198"></a>00198 
<a name="l00213"></a>00213 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00214"></a>00214 <a class="code" href="group__gdsl__heap.html#ga487b264a271d14cb9feeef6f70c31ff0" title="Substitute the top element of a heap by a lesser one.">gdsl_heap_set_top</a> (gdsl_heap_t H, 
<a name="l00215"></a>00215            <span class="keywordtype">void</span>* VALUE
<a name="l00216"></a>00216            );
<a name="l00217"></a>00217 
<a name="l00236"></a>00236 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00237"></a>00237 <a class="code" href="group__gdsl__heap.html#ga908a843511c403c581b5ec6c415c5da3" title="Insert an element into a heap (PUSH).">gdsl_heap_insert</a> (gdsl_heap_t H,
<a name="l00238"></a>00238           <span class="keywordtype">void</span>* VALUE
<a name="l00239"></a>00239           );
<a name="l00240"></a>00240 
<a name="l00255"></a>00255 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00256"></a>00256 <a class="code" href="group__gdsl__heap.html#ga1dd8eec61cd56e6dcd7fb3120e634ed1" title="Remove the top element from a heap (POP).">gdsl_heap_remove_top</a> (gdsl_heap_t H
<a name="l00257"></a>00257               );
<a name="l00258"></a>00258 
<a name="l00274"></a>00274 <span class="keyword">extern</span> gdsl_heap_t
<a name="l00275"></a>00275 <a class="code" href="group__gdsl__heap.html#ga3db73501b51ca73ad181342af4003069" title="Delete the top element from a heap.">gdsl_heap_delete_top</a> (gdsl_heap_t H
<a name="l00276"></a>00276               );
<a name="l00277"></a>00277 
<a name="l00278"></a>00278 <span class="comment">/******************************************************************************/</span>
<a name="l00279"></a>00279 <span class="comment">/* Parse functions of heaps                                                   */</span>
<a name="l00280"></a>00280 <span class="comment">/******************************************************************************/</span>
<a name="l00281"></a>00281 
<a name="l00297"></a>00297 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00298"></a>00298 <a class="code" href="group__gdsl__heap.html#ga150786779bc204172a7b3479591d49d1" title="Parse a heap.">gdsl_heap_map_forward</a> (<span class="keyword">const</span> gdsl_heap_t H,
<a name="l00299"></a>00299                <a class="code" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8" title="GDSL Map element function type.">gdsl_map_func_t</a> MAP_F,
<a name="l00300"></a>00300                <span class="keywordtype">void</span>* USER_DATA
<a name="l00301"></a>00301                );
<a name="l00302"></a>00302 
<a name="l00303"></a>00303 <span class="comment">/******************************************************************************/</span>
<a name="l00304"></a>00304 <span class="comment">/* Input/output functions of heaps                                            */</span>
<a name="l00305"></a>00305 <span class="comment">/******************************************************************************/</span>
<a name="l00306"></a>00306 
<a name="l00322"></a>00322 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00323"></a>00323 <a class="code" href="group__gdsl__heap.html#gabed5d8db4aadd03ddf66ca54c3cf8a6d" title="Write all the elements of a heap to a file.">gdsl_heap_write</a> (<span class="keyword">const</span> gdsl_heap_t H,
<a name="l00324"></a>00324          <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00325"></a>00325          FILE* OUTPUT_FILE,
<a name="l00326"></a>00326          <span class="keywordtype">void</span>* USER_DATA
<a name="l00327"></a>00327          );
<a name="l00328"></a>00328 
<a name="l00345"></a>00345 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00346"></a>00346 <a class="code" href="group__gdsl__heap.html#gadcdcbb2f40d4fc3df08d88f0398d0059" title="Write the content of a heap to a file into XML.">gdsl_heap_write_xml</a> (<span class="keyword">const</span> gdsl_heap_t H,
<a name="l00347"></a>00347              <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00348"></a>00348              FILE* OUTPUT_FILE,
<a name="l00349"></a>00349              <span class="keywordtype">void</span>* USER_DATA
<a name="l00350"></a>00350              );
<a name="l00351"></a>00351 
<a name="l00368"></a>00368 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00369"></a>00369 <a class="code" href="group__gdsl__heap.html#ga443d3d9679d4a2e98d4723674df90475" title="Dump the internal structure of a heap to a file.">gdsl_heap_dump</a> (<span class="keyword">const</span> gdsl_heap_t H,
<a name="l00370"></a>00370         <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00371"></a>00371         FILE* OUTPUT_FILE,
<a name="l00372"></a>00372         <span class="keywordtype">void</span>* USER_DATA
<a name="l00373"></a>00373         );
<a name="l00374"></a>00374 
<a name="l00375"></a>00375 <span class="comment">/*</span>
<a name="l00376"></a>00376 <span class="comment"> * @}</span>
<a name="l00377"></a>00377 <span class="comment"> */</span>
<a name="l00378"></a>00378 
<a name="l00379"></a>00379 
<a name="l00380"></a>00380 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00381"></a>00381 <span class="preprocessor"></span>}
<a name="l00382"></a>00382 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00383"></a>00383 
<a name="l00384"></a>00384 
<a name="l00385"></a>00385 <span class="preprocessor">#endif </span><span class="comment">/* _GDSL_HEAP_H_ */</span>
<a name="l00386"></a>00386 
<a name="l00387"></a>00387 
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="gdsl__heap_8h.html">gdsl_heap.h</a>      </li>

    <li class="footer">Generated on Wed Jun 12 2013 18:18:47 for gdsl by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
